package com.szxy.hyboot.controller;

import com.alibaba.fastjson.JSON;
import com.szxy.hyboot.uitls.Result;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: zwz
 * @Date:2020/11/24 9:44
 * @Description:
 **/
@RestController
@RequestMapping("/demo")
@Slf4j
public class DemoController {
    
    /**
     * post https 测试
     */
    @PostMapping("/test")
    public Result test(@RequestBody Map<String, Object> params) {
        log.info("jsonObject: {}", JSON.toJSONString(params));
        return Result.success(params);
    }

    @GetMapping("/testGet")
    public Result testGet() {
        return Result.ok();
    }
}
